package com.zhangtai.modules.service.common;


import com.zhangtai.modules.entity.common.MailRecordEntity;
import com.zhangtai.utils.PageResult;
import com.zhangtai.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;


/**
 * 
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2020-07-15 08:48:56
 */

public interface MailRecordService {

    @GetMapping("/findMailRecordList")
    @ApiOperation(value = "分页查询")
    PageResult queryPage(@RequestParam(value = "收件人",required = false) String name,
                         @RequestParam(value = "发件人",required = false)String sendName,
                         @RequestParam(value = "收件邮箱",required = false)String receive,
                         @RequestParam(value = "status", required = false) Integer status,
                         @RequestParam(value = "oid", required = false) Long oid,
                         @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                         @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);

    @GetMapping("/infoMailRecord")
    @ApiOperation(value = "根据id查找")
    MailRecordEntity getByIdE(@RequestParam("id") Long id);

    @PostMapping("/saveMailRecord")
    @ApiOperation(value = "保存")
    R saveE(@RequestBody MailRecordEntity entity);

    @PostMapping("/updateMailRecord")
    @ApiOperation(value = "修改")
    R updateByIdE(@RequestBody MailRecordEntity entity);

    @GetMapping("/deleteOneMailRecord")
    @ApiOperation(value = "根据ID删除")
    R removeOneById(@RequestParam("id") Long id);

    @PostMapping("/deleteMailRecords")
    @ApiOperation(value = "根据ID集合删除")
    R removeByIdsE(@RequestBody List<Long> ids);
}

